import math


def nop():
    pass


def abst(x):
    if x >= 0:
        return x
    else:
        return -x


print(abst(-5))


def move(x, y, step, angle=0):
    nx = x + step * math.cos(angle)
    ny = y + step * math.sin(angle)
    return nx, ny


x, y = move(100, 100, 60, math.pi / 6)
print(x, y)
a, b, c = (10, 20, 30)
print(a, b, c)


def power(x, n=2):
    r = 1
    while n > 0:
        n = n - 1
        r = r * x
    return r


print(power(9))
print(power(9, 0))


def add_end(L=None):
    if L is None:
        L = []
    L.append('end')
    return L


def calc(*numbers):
    sum = 0
    print(type(numbers))
    for n in numbers:
        sum = sum + n
    return sum


def person(name, age, **wk):
    print('name:', name, 'age:', age, 'others:', wk)


def person1(name, age, *, city, job):
    print('name:', name, 'age:', age, 'others:', city, job)


def person2(name, age, *args, city, job):
    print('name:', name, 'age:', age, 'others:', city, job, args)


# a=add_end([1,2,3])b
b = add_end()
print(b)
print(calc(1, 2, 3))
person('zhangsan', 15, city='beijing', gender=50)
person1('lisi', 30, city='beijing', job='student')
# person2('lisi', 30, c=333, city='beijing', job='student')


def f1(a, b, c=0, *args, **kw):
    print('a =', a, 'b =', b, 'c =', c, 'args =', args, 'kw =', kw)


f1(1, 2)
f1(1, 2, 3, 'a', 'b')